package com.caishi.lkx.user.mapper;

import com.caishi.lkx.user.model.ActionModel;
import com.caishi.lkx.user.model.ActionRoleModel;
import com.zzw.common.entity.IBaseMapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author by keray
 * date:2021/4/13 9:34 上午
 */
public interface ActionRoleMapper extends IBaseMapper<ActionRoleModel, String> {

    List<ActionModel> selectUserAction(String userId, boolean status);

    @Select("<script>" +
            "SELECT count(*) = 0 FROM cu_action_role_re WHERE role_name in \n" +
            "<foreach collection='ids' index='index' item='item' open='(' separator=',' close=')'>#{item}</foreach> \n" +
            "AND deleted = 0" +
            "</script>")
    Boolean canDelete(@Param("ids") List<String> strings);
}
